home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gnome-vfs-module-2.0 / libgnomevfs / gnome-vfs-socket.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-05-01  |  3.2 KB  |  89 lines

  1. /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
  2. /* gnome-vfs-socket.h
  3.  *
  4.  * Copyright (C) 2001 Seth Nickell
  5.  * Copyright (C) 2001 Maciej Stachowiak
  6.  *
  7.  * The Gnome Library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Library General Public License as
  9.  * published by the Free Software Foundation; either version 2 of the
  10.  * License, or (at your option) any later version.
  11.  *
  12.  * The Gnome Library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Library General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Library General Public
  18.  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
  19.  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA. 
  21.  *
  22.  */
  23. /*
  24.  * Authors: Seth Nickell <snickell@stanford.edu>
  25.  *          Maciej Stachowiak <mjs@noisehavoc.org>
  26.  *          (reverse-engineered from code by Ian McKellar <yakk@yakk.net>)
  27.  */
  28.  
  29. #ifndef GNOME_VFS_SOCKET_H
  30. #define GNOME_VFS_SOCKET_H
  31.  
  32. #include <glib/gtypes.h>
  33. #include <libgnomevfs/gnome-vfs-cancellation.h>
  34. #include <libgnomevfs/gnome-vfs-file-size.h>
  35. #include <libgnomevfs/gnome-vfs-result.h>
  36.  
  37. G_BEGIN_DECLS
  38.  
  39. typedef struct GnomeVFSSocket GnomeVFSSocket;
  40.  
  41. typedef GnomeVFSResult (*GnomeVFSSocketReadFunc)  (gpointer connection,
  42.                            gpointer buffer, 
  43.                            GnomeVFSFileSize bytes, 
  44.                            GnomeVFSFileSize *bytes_read,
  45.                            GnomeVFSCancellation *cancellation);
  46. typedef GnomeVFSResult (*GnomeVFSSocketWriteFunc) (gpointer connection, 
  47.                            gconstpointer buffer,
  48.                            GnomeVFSFileSize bytes,
  49.                            GnomeVFSFileSize *bytes_written,
  50.                            GnomeVFSCancellation *cancellation);
  51.  
  52. typedef void           (*GnomeVFSSocketCloseFunc) (gpointer connection,
  53.                            GnomeVFSCancellation *cancellation);
  54.  
  55. typedef GnomeVFSResult (*GnomeVFSSocketSetTimeoutFunc) (gpointer connection,
  56.                             GTimeVal *timeout,
  57.                             GnomeVFSCancellation *cancellation);
  58.  
  59. typedef struct {
  60.   GnomeVFSSocketReadFunc read;
  61.   GnomeVFSSocketWriteFunc write;
  62.   GnomeVFSSocketCloseFunc close;
  63.   GnomeVFSSocketSetTimeoutFunc set_timeout;
  64. } GnomeVFSSocketImpl;
  65.  
  66.  
  67. GnomeVFSSocket* gnome_vfs_socket_new     (GnomeVFSSocketImpl *impl, 
  68.                       void               *connection);
  69. GnomeVFSResult  gnome_vfs_socket_write   (GnomeVFSSocket     *socket, 
  70.                       gconstpointer       buffer,
  71.                       int                 bytes, 
  72.                       GnomeVFSFileSize   *bytes_written,
  73.                       GnomeVFSCancellation *cancellation);
  74. GnomeVFSResult  gnome_vfs_socket_close   (GnomeVFSSocket     *socket,
  75.                       GnomeVFSCancellation *cancellation);
  76. GnomeVFSResult  gnome_vfs_socket_read    (GnomeVFSSocket     *socket, 
  77.                       gpointer            buffer, 
  78.                       GnomeVFSFileSize    bytes, 
  79.                       GnomeVFSFileSize   *bytes_read,
  80.                       GnomeVFSCancellation *cancellation);
  81. GnomeVFSResult  gnome_vfs_socket_set_timeout
  82.                      (GnomeVFSSocket *socket,
  83.                       GTimeVal *timeout,
  84.                       GnomeVFSCancellation *cancellation);
  85. void            gnome_vfs_socket_free   (GnomeVFSSocket *socket);
  86. G_END_DECLS
  87.  
  88. #endif /* GNOME_VFS_SOCKET_H */
  89.